<!DOCTYPE html>
<html>
<head>
<include file="public:headtop" />
<link href="/static/css/homePage.css" rel="stylesheet">
<link rel="stylesheet" href="/static/css/general.css" />
    <style>
        hr {margin: 5px 0px;}
        .quick-search {padding: 10px 0}
        .quick-search li {display: inline-block; margin-right: 10px;}
    </style>
</head>
<body>
	<div class="search">
    	<div class="poto">  
    		<form action="" method="get" id="From">
                <input name="m" value="book" type="hidden"/>
                <input name="a" value="cate" type="hidden"/>
    			<div class="se">
	                <input type="text" name="key" placeholder="" id="mySearch" autofocus="autofocus" >
	       		</div>
	            <div class="img-box beBlock" id="img-box"><input type="submit" value="" id="input-search"/></div>
    		</form>
        </div>
        <div class="bg"><img src="/static/images/img02.png" alt="icon"></div>
    </div>

<div class="container">
    <h3 class="quick-search-tip">大家都在搜</h3>
    <hr/>
    <ul class="quick-search">
        <volist name="tips" id="tip">
            <li><a href="{:U('book/cate') . '&key=' . urlencode($tip);  }">{$tip}</a></li>
        </volist>
    </ul>
</div>

</body>
<script>
    $(function() {
        var Input =  $('input#mySearch');
        Input.focus();

        $('#From').submit(function(evt) {
            var key = Input.val();
            if(!key || typeof(key)=='undefined') {
                alert('请先输入要搜索的内容');
                Input.focus();
                evt.preventDefault();
            }
        });
    });
</script>
</html>
